<?php 
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="ISO-8859-1"?>';

include("../db/opendb.php");
include("functions.php");

$type=$_GET['type'];


$query = "select * from Reports where Report_Type = '".$type."'";

$result = mysql_query($query) or die ("SQL Error".mysql_error());

$xml .= "<reports>";

while ($row = mysql_fetch_assoc($result))
{
	$xml.= '<report>';
	$xml.= '<id>'.$row['ID'].'</id>';
	$xml.= '<report_title><![CDATA['.$row['Report_Title'].']]></report_title>';
	$xml.= '<report_body><![CDATA['.$row['Report_Body'].']]></report_body>';
	$xml.= '</report>';
}

$xml .= '</reports>';

echo $xml;

?>

